package com.luojun.entity;

import java.util.List;

public class Page<T> {
	private List<T> list; //集合列表
	private int nowPageNum;//当前页
	private int pageSize; //每页显示几条数据
	private int upPageNum; //上一页
	private int nextPageNum; //下一页
	private int allPageNum; //总页数
	private int allCount; //总数据数
	public Page(int PageNum, int pageSize) {
		super();
		this.nowPageNum = PageNum;
		this.pageSize = pageSize;
	}
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	public int getNowPageNum() {
		return nowPageNum;
	}
	public void setNowPageNum(int nowPageNum) {
		this.nowPageNum = nowPageNum;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getUpPageNum() {
		return upPageNum;
	}
	public void setUpPageNum(int upPageNum) {
		this.upPageNum = upPageNum;
	}
	public int getNextPageNum() {
		return nextPageNum;
	}
	public void setNextPageNum(int nextPageNum) {
		this.nextPageNum = nextPageNum;
	}
	public int getAllPageNum() {
		return allPageNum;
	}
	public void setAllPageNum(int allPageNum) {
		this.allPageNum = allPageNum;
	}
	public int getAllCount() {
		return allCount;
	}
	public void setAllCount(int allCount) {
		this.allCount=allCount;
		if(allCount%pageSize==0){
			allPageNum=allCount/pageSize;
		}else{
			allPageNum=allCount/pageSize+1;
		}
		if(nowPageNum>1){
			upPageNum=nowPageNum-1;
		}else{
			upPageNum=1;
		}
		if(nowPageNum<allPageNum){
			nextPageNum=nowPageNum+1;
		}else{
			nextPageNum=allPageNum;
		}
	
	}
	
	
}
